<?php
// Call SmartXMLElementTest::main() if this source file is executed directly.
if (!defined("PHPUnit2_MAIN_METHOD")) {
    define("PHPUnit2_MAIN_METHOD", "SmartXMLElementTest::main");
}

require_once "PHPUnit2/Framework/TestCase.php";
require_once "PHPUnit2/Framework/TestSuite.php";

// You may remove the following line when all tests have been implemented.
require_once "PHPUnit2/Framework/IncompleteTestError.php";

require_once "SmartXMLElement.php";

/**
 * Test class for SmartXMLElement.
 * Generated by PHPUnit2_Util_Skeleton on 2007-05-11 at 11:34:39.
 */
class SmartXMLElementTest extends PHPUnit2_Framework_TestCase {
    /**
     * Runs the test methods of this class.
     *
     * @access public
     * @static
     */
    public static function main() {
        require_once "PHPUnit2/TextUI/TestRunner.php";

        $suite  = new PHPUnit2_Framework_TestSuite("SmartXMLElementTest");
        $result = PHPUnit2_TextUI_TestRunner::run($suite);
    }

    /**
     * Sets up the fixture, for example, open a network connection.
     * This method is called before a test is executed.
     *
     * @access protected
    **/
    protected function setUp() {}

    /**
     * Tears down the fixture, for example, close a network connection.
     * This method is called after a test is executed.
     *
     * @access protected
    **/
    protected function tearDown() {}

    /**
     * @todo Implement testValidateSchema().
     */
    public function testSetSchema() {
		$xml = "<test><el1>element 1</el1></test>";
       	$sxe = new SmartXMLElement($xml);
		$sxe->addAttribute("version","0.1","http://www.truc.com");
		$sxe2 = new SmartXMLElement("<new/>");
		$sxe2->addAttribute("version","0.1","http://www.autretruc.com");
		$sxe2->value = 33;
		$sxe2->value2 = 34;
		$sxe->appendSXE($sxe2);
		print($sxe->asXML());
    }

}

// Call SmartXMLElementTest::main() if this source file is executed directly.
if (PHPUnit2_MAIN_METHOD == "SmartXMLElementTest::main") {
    SmartXMLElementTest::main();
}
?>
